package com.msb.sentinel.controller;

import com.msb.sentinel.service.SentinelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/****************************************************
 * 测试类
 * @author lbf
 * @date 2025/6/19 14:45
 ****************************************************/
@RestController
public class FlowlimitController {

    @GetMapping("/testA")
    public String testA() {

        return "testA------测试";
    }

    @GetMapping("/testB")
    public String testB(){
        return "testB------测试";
    }

    //--------------------------------------------- 流控模式--链路--------------------------------------

    @Autowired
    private SentinelService sentinelService;

    @GetMapping("/testC")
    public String testC(){
        return sentinelService.common();
    }

    @GetMapping("/testD")
    public String testD(){
        return sentinelService.common();
    }

    /**
     * 流控效果--预热
     *
     * @return
     */
    @GetMapping("/testE")
    public String testE(){
        return "测试预热";
    }

    /**
     * 流控效果--排队等待
     *
     * @return
     */
    @GetMapping("/testF")
    public String testF(){

        System.out.println(Thread.currentThread().getName()+" testF");
        return "排队等待";
    }



}
